/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package managedbean;

import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import session.stateless.SystemUserSessionBean;
import entity.SystemUserEntity;
import java.util.ArrayList;
import javax.faces.model.SelectItem;

/**
 *
 * @author wei
 */
@ManagedBean(name = "systemUserDataTableBean")
@RequestScoped
public class SystemUserDataTableBean {

    private List<SelectItem> usersDropList;
    @EJB
    private SystemUserSessionBean userSessionBean;

    /** Creates a new instance of SystemUserDateTableBean */
    public SystemUserDataTableBean() {
       
    }

    public List<SystemUserEntity> getUsers() {
        List<SystemUserEntity> users = getUserSessionBean().getAllSystemUsers();
        return users;
    }
    
    /**
     * @return the usersList
     */
    public List<SelectItem> getUsersDropList() {
         usersDropList = new ArrayList();
         usersDropList = userSessionBean.getSystemUserDropList();
        return usersDropList;
    }


    /**
     * @return the userSessionBean
     */
    public SystemUserSessionBean getUserSessionBean() {
        return userSessionBean;
    }

    /**
     * @param userSessionBean the userSessionBean to set
     */
    public void setUserSessionBean(SystemUserSessionBean userSessionBean) {
        this.userSessionBean = userSessionBean;
    }

    /**
     * @param usersList the usersList to set
     */
    public void setUsersDropList(List<SelectItem> usersList) {
        this.usersDropList = usersList;
    }
}
